# import time
# from selenium import webdriver
# from selenium.webdriver.common.by import By
# from selenium.webdriver.support.ui import WebDriverWait
# from selenium.webdriver.support import expected_conditions as EC
# # from ele import *
# class Crmeb:
#     def __init__(self,url,browser):
#         self.browser = browser
#         self.browser.get(url)
#         time.sleep(2)
#         self.browser.maximize_window()
#         time.sleep(2)
#         self.browser.implicitly_wait(15)
#     def login(self,username,password):
#         WebDriverWait(self.browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,"el-input__inner")))[0].send_keys(username)
#         time.sleep(2)
#         WebDriverWait(self.browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,"el-input__inner")))[1].send_keys(password)
#         time.sleep(2)
#         WebDriverWait(self.browser,10,0.5).until(EC.presence_of_element_located((By.XPATH,"//*[text()='登录']"))).click()
#         time.sleep(2)
#     def adduser(self,groupname):
#         self.groupname = groupname
#         WebDriverWait(self.browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,"font12")))[1].click()
#         time.sleep(2)
#         WebDriverWait(self.browser,10,0.5).until(EC.presence_of_element_located((By.XPATH,"//*[text()='用户分组']"))).click()
#         time.sleep(2)
    #     WebDriverWait(self.browser, 10, 0.5).until(EC.presence_of_element_located((By.XPATH, "//*[text()='添加分组']"))).click()
    #     time.sleep(2)
    #     WebDriverWait(self.browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,"el-input__inner")))[2].send_keys(groupname)
    #     time.sleep(2)
    #     WebDriverWait(self.browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,"el-button")))[2].click()
    #     time.sleep(2)
    # def deleteuser(self):
    #     time.sleep(3)
    #     WebDriverWait(self.browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,"el-notification__closeBtn")))[0].click()
    #     time.sleep(2)
        # WebDriverWait(self.browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME, "el-notification__closeBtn")))[2].click()
        # time.sleep(3)
        # WebDriverWait(self.browser,10,0.5).until(EC.presence_of_all_elements_located((By.XPATH, "//*[text()='删除']")))[-1].click()
        # time.sleep(3)
        # WebDriverWait(self.browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,"el-button")))[2].click()
        # time.sleep(2)
#     def assert_add(self):
#         text = WebDriverWait(self.browser,10,0.5).until(EC.presence_of_element_located((By.XPATH,f"//*[text()='{self.groupname}']"))).text
#         assert text == 'hello'
#         time.sleep(2)
# if __name__ == '__main__':
#     driver = webdriver.Chrome()
#     url = "http://121.40.86.4:8899/admin/login"
#     c1 = Crmeb(url,driver)
#     c1.login("admin","Aa010903!")
#     c1.adduser("hello")
#     c1.deleteuser()
#     c1.assert_add()




# import time
# from selenium import webdriver
# from selenium.webdriver.common.by import By
# # from selenium.webdriver.support.ui import WebDriverWait
# # from selenium.webdriver.support import expected_conditions as EC
# driver = webdriver.Chrome()
# 登录网站
# driver.get("https://y.qq.com/portal/pop_login.html")
# time.sleep(2)
# # 全屏化
# driver.maximize_window()
# # 设置隐式等待
# driver.implicitly_wait(15)
# 定位iframe内联框架
# iframe = driver.find_elements(By.TAG_NAME,"iframe")[0]
# time.sleep(2)
# # 跳进iframe
# driver.switch_to.frame(iframe)
# time.sleep(2)
# 点击登录
# driver.find_element(By.ID,"img_out_1436639547").click()
# time.sleep(2)


